<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>添加商品</title>
	<script type='text/javascript' src='http://localhost/oshop/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/oshop/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/oshop/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/oshop/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/oshop/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://localhost';
		ROOT = 'http://localhost/oshop';
		WEB = 'http://localhost/oshop/admin.php';
		URL = 'http://localhost/oshop/admin.php/Index/Goods/add';
		HDPHP = 'http://localhost/oshop/hdphp/hdphp';
		HDPHPDATA = 'http://localhost/oshop/hdphp/hdphp/Data';
		HDPHPTPL = 'http://localhost/oshop/hdphp/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://localhost/oshop/hdphp/hdphp/Extend';
		APP = 'http://localhost/oshop/admin.php/Index';
		CONTROL = 'http://localhost/oshop/admin.php/Index/Goods';
		METH = 'http://localhost/oshop/admin.php/Index/Goods/add';
		GROUP = 'http://localhost/oshop/Oshop';
		TPL = 'http://localhost/oshop/Oshop/Admin/Index/Tpl';
		CONTROLTPL = 'http://localhost/oshop/Oshop/Admin/Index/Tpl/Goods';
		STATIC = 'http://localhost/oshop/Static';
		PUBLIC = 'http://localhost/oshop/Oshop/Admin/Index/Tpl/Public';
		HISTORY = 'http://localhost/oshop/admin.php/Index/Goods/category';
		HTTPREFERER = 'http://localhost/oshop/admin.php/Index/Goods/category';
</script>
      <style>     
           #add{
                color:red;
                cursor:pointer;
                /*border:1px solid red;*/
                height:100px;
           }
           .bac{
               background:#F3F3F3;
           }
           .guige{
            cursor:pointer;
           }

       </style>
          <script type='text/javascript' src='http://localhost/oshop/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/oshop/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/oshop/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/oshop/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/oshop/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://localhost';
		ROOT = 'http://localhost/oshop';
		WEB = 'http://localhost/oshop/admin.php';
		URL = 'http://localhost/oshop/admin.php/Index/Goods/add';
		HDPHP = 'http://localhost/oshop/hdphp/hdphp';
		HDPHPDATA = 'http://localhost/oshop/hdphp/hdphp/Data';
		HDPHPTPL = 'http://localhost/oshop/hdphp/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://localhost/oshop/hdphp/hdphp/Extend';
		APP = 'http://localhost/oshop/admin.php/Index';
		CONTROL = 'http://localhost/oshop/admin.php/Index/Goods';
		METH = 'http://localhost/oshop/admin.php/Index/Goods/add';
		GROUP = 'http://localhost/oshop/Oshop';
		TPL = 'http://localhost/oshop/Oshop/Admin/Index/Tpl';
		CONTROLTPL = 'http://localhost/oshop/Oshop/Admin/Index/Tpl/Goods';
		STATIC = 'http://localhost/oshop/Static';
		PUBLIC = 'http://localhost/oshop/Oshop/Admin/Index/Tpl/Public';
		HISTORY = 'http://localhost/oshop/admin.php/Index/Goods/category';
		HTTPREFERER = 'http://localhost/oshop/admin.php/Index/Goods/category';
</script>
       <script type="text/javascript" src="http://localhost/oshop/Oshop/Admin/Index/Tpl/Goods/js/js.js"></script>
</head>
<body>
	<form method="post" enctype="multipart/form-data" class="hd-form">
                        <div class="wrap">
			<div class="menu_list">
				<ul>
				<li>
					<a href="<?php echo U(index);?>">商品列表</a>
				</li>
				<li>
					<a href="" class="action">添加商品</a>
				</li>
			                  </ul>
			</div>
                                    <div class="tab">
				<ul class="tab_menu">
					<li lab="base" class='action'>
						<a >基本信息</a>
					</li>
					<li lab="content">
						<a >详细内容</a>
					</li>
					<li lab="pic">
						<a >图片
						</a>
					</li>
				</ul>
	
                                    <div class="tab_content">	
				<!-- 基本信息 -->
                                    <div id="base" >
                                    	<table class="table1 hd-form" >
                                    		<tr>
                                    			<th class="w150">名称</th>
                                    			<td >
                                    				<input type="text" name="gname" id="" class="w300">
                                    			</td>
                                    		</tr>
                                    		<tr>
                                    			<th class="w150">属性</th>
                                    			<td >
                                    				<label>置顶<input type="checkbox" name="flag[]" id="" value="置顶"></label>
                                    				<label>推荐<input type="checkbox" name="flag[]" id="" value="推荐"></label>
                                    			</td>
                                    		</tr>
                                    		<tr>
                                    			<th class="w150">栏目</th>
                                    			<td >
                                    				          <?php $hd["list"]["d"]["total"]=0;if(isset($data) && !empty($data)):$_id_d=0;$_index_d=0;$lastd=min(1000,count($data));
$hd["list"]["d"]["first"]=true;
$hd["list"]["d"]["last"]=false;
$_total_d=ceil($lastd/1);$hd["list"]["d"]["total"]=$_total_d;
$_data_d = array_slice($data,0,$lastd);
if(count($_data_d)==0):echo "";
else:
foreach($_data_d as $key=>$d):
if(($_id_d)%1==0):$_id_d++;else:$_id_d++;continue;endif;
$hd["list"]["d"]["index"]=++$_index_d;
if($_index_d>=$_total_d):$hd["list"]["d"]["last"]=true;endif;?>

                                                                         <?php if($d['cid'] == $arr[1]){?><?php echo $d['cname'];?>
                                                                          <input type="hidden" name="cid" value="<?php echo $d['cid'];?>">
                                                                         <?php }?>
                                    				          <?php $hd["list"]["d"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
                                    			</td>
                                    		 </tr>
                                            <tr>
                                              <th class="w150">商品属性类型</th>
                                                <td>
                                                  <table>
                                                   <?php $hd["list"]["attr"]["total"]=0;if(isset($attrData) && !empty($attrData)):$_id_attr=0;$_index_attr=0;$lastattr=min(1000,count($attrData));
$hd["list"]["attr"]["first"]=true;
$hd["list"]["attr"]["last"]=false;
$_total_attr=ceil($lastattr/1);$hd["list"]["attr"]["total"]=$_total_attr;
$_data_attr = array_slice($attrData,0,$lastattr);
if(count($_data_attr)==0):echo "";
else:
foreach($_data_attr as $key=>$attr):
if(($_id_attr)%1==0):$_id_attr++;else:$_id_attr++;continue;endif;
$hd["list"]["attr"]["index"]=++$_index_attr;
if($_index_attr>=$_total_attr):$hd["list"]["attr"]["last"]=true;endif;?>

                                                    <tr>
                                                      <th><?php echo $attr['attr_name'];?></th>
                                                    <td><?php echo $attr['html'];?></td>
                                                    </tr>
                                                   <?php $hd["list"]["attr"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
                                                    </table>
                                                </td>
                                            </tr>

                                             <tr>
                                              <th class="w150">商品属性规格</th>
                                                <td>
                                                  <table>
                                                    <tr align="center">
                                                      <?php $hd["list"]["spec"]["total"]=0;if(isset($GoodSpecData) && !empty($GoodSpecData)):$_id_spec=0;$_index_spec=0;$lastspec=min(1000,count($GoodSpecData));
$hd["list"]["spec"]["first"]=true;
$hd["list"]["spec"]["last"]=false;
$_total_spec=ceil($lastspec/1);$hd["list"]["spec"]["total"]=$_total_spec;
$_data_spec = array_slice($GoodSpecData,0,$lastspec);
if(count($_data_spec)==0):echo "";
else:
foreach($_data_spec as $key=>$spec):
if(($_id_spec)%1==0):$_id_spec++;else:$_id_spec++;continue;endif;
$hd["list"]["spec"]["index"]=++$_index_spec;
if($_index_spec>=$_total_spec):$hd["list"]["spec"]["last"]=true;endif;?>

                                                        <td><?php echo $spec['attr_name'];?></td>
                                                      <?php $hd["list"]["spec"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
                                                      <td>库存</td>
                                                      <td>价格</td>
                                                      <td>货号</td>
                                                      <td>操作</td>
                                                    </tr>
                                                  <tbody>
                                                        <tr class="one">
                                                       <?php $hd["list"]["spec"]["total"]=0;if(isset($GoodSpecData) && !empty($GoodSpecData)):$_id_spec=0;$_index_spec=0;$lastspec=min(1000,count($GoodSpecData));
$hd["list"]["spec"]["first"]=true;
$hd["list"]["spec"]["last"]=false;
$_total_spec=ceil($lastspec/1);$hd["list"]["spec"]["total"]=$_total_spec;
$_data_spec = array_slice($GoodSpecData,0,$lastspec);
if(count($_data_spec)==0):echo "";
else:
foreach($_data_spec as $key=>$spec):
if(($_id_spec)%1==0):$_id_spec++;else:$_id_spec++;continue;endif;
$hd["list"]["spec"]["index"]=++$_index_spec;
if($_index_spec>=$_total_spec):$hd["list"]["spec"]["last"]=true;endif;?>

                                                        <td><?php echo $spec['html'];?></td>
                                                      <?php $hd["list"]["spec"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
                                                      <td>
                                                        <input type="text" name="stock[]" id="">
                                                      </td>
                                                      <td>
                                                        <input type="text" name="price[]" id="">
                                                      </td>
                                                      <td>
                                                        <input type="text" name="goods_sn[]" id="">
                                                      </td>
                                                      <td align="center">
                                                         <span class="guige" onclick="addSpec(this)" >加（+）</span>
                                                      </td>
                                                    </tr>
                                                   
                                                  </tbody>
                                                
                                                    </table>
                                                </td>
                                            </tr>


                                                 <tr>
                                                      <th class="w150">品牌</th>
                                                      <td >
                                                            <select name="brandid" id="" class="w150">
                                                                  <option value="">==请选择==</option>
                                                                      <?php $hd["list"]["bra"]["total"]=0;if(isset($brand) && !empty($brand)):$_id_bra=0;$_index_bra=0;$lastbra=min(1000,count($brand));
$hd["list"]["bra"]["first"]=true;
$hd["list"]["bra"]["last"]=false;
$_total_bra=ceil($lastbra/1);$hd["list"]["bra"]["total"]=$_total_bra;
$_data_bra = array_slice($brand,0,$lastbra);
if(count($_data_bra)==0):echo "";
else:
foreach($_data_bra as $key=>$bra):
if(($_id_bra)%1==0):$_id_bra++;else:$_id_bra++;continue;endif;
$hd["list"]["bra"]["index"]=++$_index_bra;
if($_index_bra>=$_total_bra):$hd["list"]["bra"]["last"]=true;endif;?>

                                                                        <option value="<?php echo $bra['bid'];?>"><?php echo $bra['bname'];?></option>
                                                                      <?php $hd["list"]["bra"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
                                                            </select>
                                                      </td>
                                                 </tr>
                                    		<!--  <tr>
                                    		 	<th class="w150">价格</th>
                                    		          <td>
                                    		          	<input type="text" name="price" id="" class="w300">
                                    		          </td>
                                    		 </tr> -->
                                    		<!--  <tr>
                                    		 	<th class="w150">库存</th>
                                    		          <td>
                                    		          	<input type="text" name="stock" id="" class="w300">
                                    		          </td>
                                    		 </tr> -->
                                    		  <tr>
                                    		 	<th class="w150">关键字</th>
                                    		          <td>
                                    		          	<input type="text" name="keywords" id="" class="w300">
                                    		          </td>
                                    		 </tr>
                                    		   <tr>
                                    		 	<th class="w150">描述</th>
                                    		          <td>
                                    		          	<textarea name="description" id="" cols="30" rows="10" class="w400 h100"></textarea>
                                    		          </td>
                                    		 </tr>
                                    	</table>
                                    </div>
                                    <!-- 详细信息 -->
                                        <div id="content" >
                                    	<table class="table1" >
                                    		<tr>
                                    			<th class="w150">内容</th>
                                    			<td >
                                    				<script type="text/javascript" charset="utf-8" src="http://localhost/oshop/hdphp/hdphp/Extend/Org/Ueditor/ueditor.config.js"></script><script type="text/javascript" charset="utf-8" src="http://localhost/oshop/hdphp/hdphp/Extend/Org/Ueditor/ueditor.all.min.js"></script><script type="text/javascript">UEDITOR_HOME_URL="http://localhost/oshop/hdphp/hdphp/Extend/Org/Ueditor/"</script><script id="hd_body" name="body" type="text/plain"></script>
        <script type='text/javascript'>
        $(function(){
                var ue = UE.getEditor('hd_body',{
                imageUrl:'http://localhost/oshop/admin.php?a=Index&c=Goods&m=ueditor_upload&g=Admin&water=1&uploadsize=2000000&maximagewidth=false&maximageheight=false'//处理上传脚本
                ,zIndex : 0
                ,autoClearinitialContent:false
                ,initialFrameWidth:"100%" //宽度1000
                ,initialFrameHeight:"300" //宽度1000
                ,autoHeightEnabled:false //是否自动长高,默认true
                ,autoFloatEnabled:false //是否保持toolbar的位置不动,默认true
                ,maximumWords:2000 //允许的最大字符数
                ,readonly : false //编辑器初始化结束后,编辑区域是否是只读的，默认是false
                ,wordCount:true //是否开启字数统计
                ,imagePath:''//图片修正地址
                , toolbars:[
            ['fullscreen', 'source', '|', 'undo', 'redo', '|',
                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                'directionalityltr', 'directionalityrtl', 'indent', '|',
                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
                'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe','insertcode', 'pagebreak', 'template', 'background', '|',
                'horizontal', 'date', 'time', 'spechars',  'wordimage', '|',
                'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
                'print', 'preview', 'searchreplace']
            ]//工具按钮
                , initialStyle:'p{line-height:1em; font-size: 14px; }'
            });
        })
        </script>
                                    			</td>
                                    		</tr>
                                    		<tr>
                                    			<th class="w150">服务</th>
                                    			<td >
                                    				<input type="text" name="service" id="" class="w300">
                                    			</td>
                                    		</tr>
                                    		<tr>
                                    			<th class="w150">查看次数</th>
                                    			<td >
                                    				<input type="text" name="click" id="" class="w300">
                                    			</td>
                                    		</tr>
                                                            <tr>
                                                                  <th class="w150">更新时间</th>
                                                                  <td >
                                                                        <input type="text" name="addtime" id="addtime" class="w300" readonly="readonly"   >
                                                                  </td>
                                                            </tr>
                                    	</table>
                                       </div>
                                    <div id="pic">
                                    	<table class="table1">
                                    		<tr>
                                    			<th class="w150">首页图</th>
                                    			<td ><input type="file" name="index_pic" id=""  ></td>
                                    		</tr>
                                    		<tr>
                                    			<th>列表图</th>
                                    			<td>
                                    				<input type="file" name="list_pic" id="">
                                    			</td>
                                    		</tr>
                                                            <tr>
                                                                  <th>内容图</th>
                                                                  <td id="td" >
                                                                        <div class="content">
                                                                              <input type="file" name="pic[]" id="" class="w150">
                                                                           <span id="add" >增加（+）</span>
                                                                        </div>
                                                                  </td>
                                                            </tr>
                                    	</table>
                                    </div>
                  	</div>
                  	</div>
                     
		<!-- 底部确定按钮 -->
		<div class="position-bottom">
			<input type="submit" value="确定" class="hd-success">
		</div>
	</form>
</body>
<script>
      $("#addtime").calendar({format: 'yyyy/MM/dd HH:mm:ss'});
      var input="<div style='margin-top:10px' class='content'><input type='file' name='pic[]' id= class='w150' class='w150' ><span style='color:red;margin-left:5px;cursor:pointer'  class='del1'>减少（-）<span></div>";
      $("#add").click(function(){
            $("#td").append(input);
      })
      $(".del1").live("click",function(){
            $(this).parent().remove();
      })
      $(".content").live("hover",function(){
            $(this).addClass('bac').siblings('.content').removeClass('bac');
      })
</script>
</html>








